package day9zy.cwxt;

public class Cw {
    private String name;
    private String pz;
    private double tz;

    public void setName(String name) {
        this.name = name;
    }

    public void setPz(String pz) {
        this.pz = pz;
    }

    public void setTz(double tz) {
        this.tz = tz;
    }

    public String getName() {
        return name;
    }

    public String getPz() {
        return pz;
    }

    public double getTz() {
        return tz;
    }
    public Cw(){

    }
    public Cw(String name,String pz,int tz){
        this.name = name;
        this.pz = pz;
        this.tz = tz;
    }
    public void eat(){
        System.out.println(name+"在吃");
    }
    public void sleep(){
        System.out.println(name+"在睡");
    }
    public void self(){
        System.out.println("名字："+name+"品种："+pz+"体重："+tz);
    }
}
class Dog extends Cw{
    public Dog(String name,String pz,int tz){
        super(name,pz,tz);
    }
//    public Dog(){
//
//    }
    public void zls(){
        System.out.println(getName()+"在抓老鼠");
    }
}
class Cat extends Cw{
    public Cat(String name, String pz, int tz){
        super(name,pz,tz);
    }
//    public Cat(){
//
//    }
    public void pashu(){
        System.out.println(getName()+"在爬树");
    }
}
class Yw extends Cw{
    public Yw(String name,String pz,int tz){
        super(name,pz,tz);
    }
//    public Yw(){
//
//    }
    public void fly(){
        System.out.println(getName()+"在飞");
    }
}